package com.itjiange;

/**
 * 中介者模式
 *
 * @author ItJianGe
 * @data 2024/8/22 10:23
 */
public class MediatorMain {
    public static void main(String[] args) {
        Mediator mediator = new Mediator();

        System.out.println("-------------开始采购电脑------------");
        Purchase purchase = new Purchase(mediator);
        purchase.purchaseComputer(100);

        System.out.println("-------------开始销售电脑------------");
        Sale sale = new Sale(mediator);
        sale.saleComputer(10);

        System.out.println("-------------开始清仓处理-----------");
        Stock stock = new Stock(mediator);
        stock.clearStock();
    }
}